package ch.sfug.anim {
	import flash.events.TimerEvent;
	
	import ch.sfug.events.TweenEvent;
	import ch.sfug.sequence.Sequencer;		

	/**
	 * @author mich
	 */
	public class Animation extends Sequencer implements IAnimation {

		public function Animation() {
			super();
		}


		/**
		 * adds an animation to the sequence
		 */
		public function awaitAnimation( anim:IAnimation, func:String = "start", ...args ):void {
			var asc:AnimationSequenceChild = new AnimationSequenceChild( anim, func );
			asc.setArguments( args );
			addSequenceChild( asc );
		}


		protected override function handleEnd():void {
			super.handleEnd();
			dispatchEvent( new TweenEvent( TweenEvent.TWEEN_END ) );
		}
	}
}
